var url = require("url");
var querystring = require("querystring");

function postData(req,cb){
	
    var postdata = "";
    
    req.on("data",function(buffer){
    	
        postdata+=buffer;
        
    });
    
    req.on("end",function(){
    	
        var query=querystring.parse(postdata);
        
        cb(query);
        
    });
}

function getData(req,cb){
	
    var param = url.parse(req.url,true).query;
    
    cb(param);
    
}

exports.postData=postData;
exports.getData=getData;